<template>
  <div id="app">
    <header>
      <nav>
        <router-link to="/">主页</router-link> |
        <router-link to="/public-activities">公开活动</router-link> |
        <router-link v-if="isAdmin" to="/activity-management">活动管理页</router-link> |
        <a v-if="isAuthenticated" @click="logout">Logout</a>
      </nav>
    </header>
    <main>
      <router-view />
    </main>
    <footer>
      <!-- Footer content -->
    </footer>
  </div>
</template>

<script>
import { isAuthenticated, isAdmin, logout } from './utils/auth';

export default {
  computed: {
    isAuthenticated() {
      return isAuthenticated();
    },
    isAdmin() {
      return isAdmin();
    }
  },
  methods: {
    logout() {
      logout();
      this.$router.push('/login');
    }
  }
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header, footer {
  background-color: #f8f9fa;
  padding: 1rem;
}

nav {
  padding: 0.5rem;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
  margin: 0 0.5rem;
  text-decoration: none;
}

nav a.router-link-exact-active {
  color: #42b983;
}

main {
  flex: 1;
  padding: 2rem;
}

footer {
  text-align: center;
}
#app {
  /* ... other styles ... */
  padding: 1rem;
}

@media (min-width: 768px) {
  #app {
    padding: 2rem;
  }

  main {
    padding: 4rem;
  }
}

@media (min-width: 1024px) {
  .hello {
    max-width: 1000px;
  }
}
</style>